import { get, post, put, del } from "../utils/request";
export type FetchUser = {
  // Developer?: boolean;
  UserID: number;
  Username: string;
  OrgID: number;
  FirstName: string;
  LastName: string;
  Email: string;
  Token?: string;
  Status?: string;
  CreateDate?: number;
  LastUpdate?: number;
  Password?: string;
  RoleString?: string;
};
export type Group = {
  OrgID: number;
  OrgName: string;
  ClinicType: boolean;
  ServiceType: boolean;
  StreetAddress: string;
  City: String;
  State: string;
  PostalCode: string;
  Country: string;
  PrimaryPhone: string;
  SecondPhone: string;
  Email: string;
  Fax: string;
  CreateDate: number;
  LastUpdate: number;
  Status: string;
  TimeZone: string;
};
/**
 * 登录
 * @param username
 * @param password
 * @returns
 */
export async function login(email: string, password: string, code: string) {
  const res = await post<FetchUser>("/api/login", { email, password, code });
  return res;
}
export async function getGroupById(id: number) {
  return await get<Group>(`/api/org?id=${id}`, {});
}

export async function extendExample({pagesize,pageno,...params}:{pagesize?:number;pageno?:number;order?:"asc"|"desc";}){
  return await get<Group>(`/api/org?pagesize={pagesize}`, {});
}